@extends('layout/index')
@section('main')
    <div class="mws-panel grid_8">
        <div class="mws-panel-header">
            <span>添加商品</span>
        </div>
        @if (count($errors) > 0)
            <div class="mws-form-message error">
                <ul>
                    @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                    @endforeach
                </ul>
            </div>
        @endif
        <div class="mws-panel-body no-padding">
            <form class="mws-form" action="insert" method="post" enctype="multipart/form-data">
                <div class="mws-form-inline">
                    <div class="mws-form-row">
                        <label class="mws-form-label">商品名称</label>
                        <div class="mws-form-item">
                            <input class="small" type="text" name="goodsname">
                        </div>
                    </div>

                    <div class="mws-form-row">
                        <label class="mws-form-label">商品分类</label>
                        <div class="mws-form-item">
                            <select class="small" name="tid">
                                    {{--@foreach($pid as $v)--}}
                                        {{--<option value="{{$v->id}}">{{$v->typename}}</option>--}}
                                    {{--@endforeach--}}
                                @foreach($res as $k => $v)
                                    <option id="tid" value="{{ $v->id }}">{{ $v->typename }}</option>
                                @endforeach

                            </select>
                        </div>
                    </div>

                    <div class="mws-form-row">
                        <label class="mws-form-label">商品图片</label>
                        <div class="mws-form-item">
                            <div class="small">
                                <input type="file" name="goodspic">
                            </div>
                        </div>
                    </div>

                    <div class="mws-form-row">
                        <label class="mws-form-label">商品价格</label>
                        <div class="mws-form-item">
                            <input class="small" type="text" name="goodsprice">
                        </div>
                    </div>

                    <div class="mws-form-row">
                        <label class="mws-form-label">库存</label>
                        <div class="mws-form-item">
                            <input class="small" type="text" name="goodsnum">
                        </div>
                    </div>

                    <div class="mws-form-row">
                        <label class="mws-form-label">商品状态</label>
                        <div class="mws-form-item clearfix">
                            <ul class="mws-form-list inline">
                                <li><input type="radio" name="status" value="1" checked> <label>上架</label></li>
                                <li><input type="radio" name="status" value="0"> <label>下架</label></li>

                            </ul>
                        </div>
                    </div>

                    <div class="mws-form-row">
                        <label class="mws-form-label">商品描述</label>
                        <div class="mws-form-item">
                            <textarea rows="" cols="" class="small" name="goodsdes"></textarea>
                        </div>
                    </div>

                </div>
                {{ csrf_field() }}
                <div class="mws-button-row">
                    <input value="添加" class="btn btn-danger" type="submit">
                    <input value="重置" class="btn " type="reset">
                </div>
            </form>
        </div>
    </div>

@stop
    